/* Endless Code Copyright (C) 2009 Jingul,Kim
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
package ec.sys;

/**
 * @since 2009
 * @version 1.0
 * @author <a href="mailto:jingul.kim@gmail.com">Jingul,Kim</a>
 */
public class Display {
	private static Proc proc; 
	
	private int handle;

	public native boolean create();

	public native void destroy();

	public native void show();

	public native void hide();

	public native void dispatch();
	
	protected Display() {
	}
	
	public void nextFrame() {
	}

	public int getHandle() {
		return handle;
	}

	public static void dispatchNative(int type, int lFlag, int rFlag) {
		proc.nativeProc(type, lFlag, rFlag);
	}
	
	public static void dispatchMouse(int type, int button, int x, int y) {
		proc.mouseProc(type, button, x, y);
	}
	
	protected void setProc(Proc proc) {
		Display.proc = proc;
	}
	
	public native void setSize(int w, int h);
	
	static {
		System.loadLibrary("sys");
	}
}
